home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- # MPing 1.1 - MacTCP Ping Tool
- #
- # Copyright © Apple Computer, Inc. 1990-1991
- # All rights reserved.
- #
- # Versions:
- # 1.1 September 25, 1991.
- #
- # File:
- # MPing.c
- #
- # Components:
- # AddressXlation.h
- # MacTCPCommonTypes.h
- # Makefile
- # MiscIPPB.h
- # MPing.c
- # MPing.h
- # MPing.r
- # MPingDlg.c
- # MPingExtern.h
- # MPingGlobals.h
- # MPingIcmp.c
- # MPingWindow.c
- # resolver.c
- ------------------------------------------------------------------------------*/
-
- #define PINGGO_BUTTON 1
- #define PINGSTOP_BUTTON 2
- #define QUIT_BUTTON 3
- #define HOSTADDR_EDIT 5
- #define SENDTEXT_RADIO 6
- #define SENDTEXT_EDIT 7
- #define SENDPATTERN_RADIO 8
- #define SENDPATTERN_EDIT 9
- #define PACKETSIZE_EDIT 11
- #define QUIET_RADIO 13
- #define VERBOSE_RADIO 14
- #define NOOFPKTS_CHECK 15
- #define NOOFPKTS_EDIT 16
- #define WAITSEC_EDIT 19
-
- #define MAX_IOPB_QUEUE 60
- #define MAX_OPT_SIZE 40
- #define ICMP_TIME_DELAY 60
- #define ICMP_TIME_WAKEUP 0
- #define MIN_TIME_DELAY 1
- #define WARP_SPEED 1
- #define DEFAULT_ICMP_SIZE 56
- #define MAX_ICMP_SIZE 5000
- #define MAX_IP_OPT_LEN 50
- #define MAX_PKT_NO_RESP 50
- #define DEFAULT_PKT_COUNT 5
- #define MASK_HIGH 0xF0
- #define MASK_LOW 0x0F
-
- /* the ipoptns structure defines the format of individual IP options
- within the ip4 header */
-
- #define IPO_EOL 0 /* end of options list */
- #define IPO_NOP 1 /* ip "nop" option */
- #define IPO_SEC 130 /* security option */
- #define IPO_LSRR 131 /* loose source & record route */
- #define IPO_SSRR 137 /* strict source & record route */
- #define IPO_RR 7 /* record route option */
- #define IPO_SID 136 /* stream ID option */
- #define IPO_TIME 68 /* internet timestamp option */
-
-
- typedef struct {
- DialogRecord pingdialog;
- TEHandle docTE;
- ControlHandle docVScroll;
- ProcPtr docClik;
- } DocumentRecord, *DocumentPeek;
-
- struct PingStatistics {
- unsigned long minTime; /* minimum round trip time */
- unsigned long avgTime; /* average round trip time */
- unsigned long maxTime; /* maximum round trip time */
- unsigned long totTime; /* sum of round trip time of all icmp packets received */
- long totPktOut; /* no of icmp requests sent */
- long totPktIn; /* no of icmp replies received */
- long totPktBad; /* no of bad icmp replies */
- long pktLoss; /* percentage packet loss */
- };
-
- struct Record_Route_Info { /* includes RR, LSRR and SSRR */
- b_8 opt_type;
- b_8 opt_len;
- b_8 opt_ptr;
- b_32 route_1;
- b_32 route_2;
- b_32 route_3;
- b_32 route_4;
- b_32 route_5;
- };
-
- struct Security_Info {
- b_8 opt_type;
- b_8 opt_len;
- b_16 Security_SS;
- b_16 Compartments_CC;
- b_16 HandlingRestrictions_HH;
- b_16 TCC_1; /* first 16 2 bytes of Transimission Control Code */
- b_8 TCC_2; /* 3rd byte of TCC */
- };
-
- struct Stream_Indentifier_Info {
- b_8 opt_type;
- b_8 opt_len;
- b_16 stream_id;
- };
-
- struct Internet_Timestamp_Info {
- b_8 opt_type;
- b_8 opt_len;
- b_8 opt_ptr;
- b_8 oflwflag;
- b_32 ipAddr_TS1;
- b_32 time_stamp2;
- b_32 ipAddr_TS3;
- b_32 time_stamp4;
- b_32 ipAddr_TS5;
- b_32 time_stamp6;
- b_32 ipAddr_TS7;
- b_32 time_stamp8;
- };
-
- struct EchoResponseStatus {
- unsigned long pkt_no; /* resonse number */
- unsigned long rt_time; /* round trip time */
- unsigned short pkt_len; /* response length */
- Boolean response_ok; /* true of success, else false */
- };
-